/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dell
 * Date: 2023-11-20
 * Time: 21:03
 */
class Dog{
    String name;
    int age;
    static  int dogmother;
    static {
        System.out.println(dogmother);
        System.out.println("非静态代码块");
        dogmother=10;
        System.out.println(dogmother);
        Dog.work();
    }
     /*Dog(){
         System.out.println("是狗狗");
     }
     Dog(String a){

         this();
         System.out.println("=============================");
         System.out.println(a+14);
     }*/

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public static void work(){
        System.out.println("汪汪汪汪汪汪");
    }
    public  void eat(){
        dogmother++;
        System.out.println("吃饭");
        System.out.println("=================");
        this.work();
    }
}
public class main5 {
    public static void main(String[] args) {
        System.out.println("开始");
        Dog dog=new Dog();
        //dog.setAge(10);
        // dog.setName("小白");
       /* System.out.println(dog.getAge());
        System.out.println(dog.getName());
        dog.eat();
        System.out.println("===============");*/
        /*/System.out.println(dog.dogmother);
        Dog dogs=new Dog("dogwo");
        dogs.eat();
        System.out.println(dogs.dogmother);;
        System.out.println(Dog.dogmother);*/
    }
/////// 先找到main方法， 然后先加载main 方法所在的类JVMTest的静态属性，
// 静态代码块（按照顺序加载），即使静态代码块在main方法下面也要先加载静态代码块。然后执行 main方法
//  然后再跟据调用的类，重复以上操作，
}